package demo.game.chess.common;

public class KingAttackException extends MoveException {

	private final AbstractChessPiece kingAttackerPiece;

	private final ChessMove kingAttackMove;

	public KingAttackException(final ChessMove invalidMove,
			final ChessBoard predictBoard, final ChessMove kingAttackMove) {

		super(invalidMove, invalidMove + " invalid: see the attack "
				+ kingAttackMove);

		this.kingAttackerPiece = predictBoard.getPieceAt(kingAttackMove
				.getOriginCell());
		this.kingAttackMove = kingAttackMove;
	}

	public AbstractChessPiece getKingAttackerPiece() {
		return this.kingAttackerPiece;
	}

	public ChessMove getKingAttackMove() {
		return this.kingAttackMove;
	}

}
